Project Description¶
In this project, we will explore time series data to analyze and compare the popularity trends of three well-known AI tools: ChatGPT, Gemini, and Microsoft Copilot. Our goal is to study how public interest in these tools has changed over time, and to identify which tool is becoming more popular.
We are assuming the role of a team that is monitoring the AI tools market. By understanding how interest in these tools is evolving, we can gain valuable insights. This can help us decide where to focus marketing efforts, what tools are gaining user attention, and how our company might adjust its strategy in the AI space.
We will use real-world time series data to:
- Visualize and compare trends in user interest
- Detect any seasonal patterns or sudden changes
- Make observations about growth and decline in popularity
- Provide actionable insights for future planning
These insights can help decision-makers better understand market dynamics and anticipate future developments in the AI tools sector.
The Data¶
We are working with a CSV file named ai_tools_comparison.csv
which contains Google Trends data. This dataset includes weekly global search interest data for ChatGPT, Gemini, and Microsoft Copilot.
The data covers the past 12 months leading up to September 2024 and shows how interest in each tool has changed over time.
You can find the original data query on Google Trends.
By analyzing this time series data, we aim to better understand the competitive landscape of these AI tools and offer meaningful conclusions based on user interest trends.
import pandas as pd
import matplotlib.pyplot as plt
# Load the data
trends = pd.read_csv('ai_tools_comparison.csv')
# Inspect the data
trends.head()
week | chatgpt | gemini | microsoft_copilot | |
---|---|---|---|---|
0 | 2023-08-27 | 56 | 3 | 1 |
1 | 2023-09-03 | 56 | 3 | 1 |
2 | 2023-09-10 | 63 | 3 | 1 |
3 | 2023-09-17 | 64 | 3 | 1 |
4 | 2023-09-24 | 66 | 3 | 1 |
# Convert the 'week' column to datetime format for accurate time series analysis
trends['week'] = pd.to_datetime(trends['week'])
# Set the 'week' column as the index
trends.set_index('week', inplace=True)
Which AI tool has shown the most consistent growth in interest over the observed period?¶
# Calculate the week-over-week percentage change for each tool
growth_rates = trends.pct_change().fillna(0).mul(100)
# Calculate the standard deviation of the growth rates for each tool
std_dev = growth_rates.std()
# Identify the tool with the smallest standard deviation, indicating the most consistent growth
most_consistent_tool = std_dev.idxmin()
# Print the result
print(f"Most consistent tool: {most_consistent_tool}")
Most consistent tool: chatgpt
Create a visualization showing the interest levels of ChatGPT, Gemini, and Microsoft Copilot over time.¶
# Create a copy of the trends DataFrame
interest_levels = trends.copy()
# Plot the interest levels
interest_levels.plot(title="Interest Levels of ChatGPT, Gemini, and Microsoft Copilot Over Time")
# Add labels to the x-axis and y-axis
plt.xlabel('Week')
plt.ylabel('Interest Levels')
# Display the plot
plt.show()
Around which month and year does ChatGPT experience its largest decline in interest?¶
# look for the lowest point on the trend line in the plot above and reading the x-axis at that point
gpt_dip = "December 2023" # Can be January 2024 too
# Print the result
print(f"The worst month and year for ChatGPT: {gpt_dip}")
The worst month and year for ChatGPT: December 2023
Explore the seasonality in the data by breaking it down into monthly averages. What month had the highest average interest across all tools?¶
# Resample the data to monthly averages
monthly_data = trends.resample('M').mean()
# Calculate the overall maximum for all tools combined
best_month = monthly_data.mean(axis=1).idxmax().strftime('%B')
# Print the result
print(f"Month with the highest interest: {best_month}")
Month with the highest interest: May
# Plot the resampled monthly data for each AI tool to check for seasonality
monthly_data.plot(subplots=False, figsize=(6, 4), title='Monthly Averages of AI Tool Metrics')
# djust the layout
plt.tight_layout()
# Display the plot
plt.show()